package com.example.enumdemo.impl;

/**
 * Created by taoli on 2018/8/5.
 */
public enum  CodeBasedUserStatus implements CodeBasedEnum{
    ENABLE(1), DISABLE(0);

    private final int code;

    CodeBasedUserStatus(int code) {
        this.code = code;
    }

    @Override
    public int code(){
        return this.code;
    }

    public static void main(String... arg){
        for (CodeBasedUserStatus codeBasedEnum : CodeBasedUserStatus.values()){
            System.out.println(codeBasedEnum.name() + ":" + codeBasedEnum.code());
        }
    }
}
